package cqut.wys.dao.mapper.user;

import cqut.wys.dao.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author wuyoushan
 * @date 2018/2/28
 */
@Mapper
public interface UserMapper {

    @Select("SELECT * FROM `tb_user` where id = #{id}")
    User findUserById(@Param("id") int id);

    @Insert("INSERT INTO `caogao`.`tb_user` (`name`, `age`, `gender`) VALUES (#{user.name}, #{user.age}, #{user.gender})")
    int addUser(@Param("user") User user);
}
